﻿using System;
using System.Runtime.InteropServices;

namespace WirelessAccessPoint.InteropServices
{
    /// <summary>
    /// The WLAN_HOSTED_NETWORK_STATUS structure contains information about the
    /// status of the wireless Hosted Network.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct WLAN_HOSTED_NETWORK_STATUS
    {
        /// <summary>
        /// The current state of the wireless Hosted Network.
        /// If the value of this member is wlan_hosted_network_unavailable,
        /// then the values of the other fields in this structure should not be
        /// used.
        /// </summary>
        public WLAN_HOSTED_NETWORK_STATE HostedNetworkState;
        
        /// <summary>
        /// The actual network Device ID used for the wireless Hosted Network.
        /// This is member is the GUID of a virtual wireless device which would
        /// not be available through calls to the WlanEnumInterfaces function.
        /// This GUID can be used for calling other higher layer networking
        /// functions that use the device GUID (IP Helper functions, for
        /// example).
        /// </summary>
        public Guid IPDeviceID;

        /// <summary>
        /// The BSSID used by the wireless Hosted Network in packets, beacons,
        /// and probe responses.
        /// </summary>
        public DOT11_MAC_ADDRESS wlanHostedNetworkBSSID;

        /// <summary>
        /// The physical type of the network interface used by wireless Hosted
        /// Network.
        /// This is one of the types reported by the related physical interface.
        /// This value is correct only if the HostedNetworkState member is
        /// wlan_hosted_network_active.
        /// </summary>
        public DOT11_PHY_TYPE dot11PhyType;

        /// <summary>
        /// The channel frequency of the network interface used by wireless
        /// Hosted Network.
        /// This value is correct only if HostedNetworkState is
        /// wlan_hosted_network_active.
        /// </summary>
        public uint ulChannelFrequency;

        /// <summary>
        /// The current number of authenticated peers on the wireless Hosted
        /// Network.
        /// This value is correct only if HostedNetworkState is
        /// wlan_hosted_network_active.
        /// </summary>
        public uint dwNumberOfPeers;
        
        /// <summary>
        /// An array of WLAN_HOSTED_NETWORK_PEER_STATE structures describing
        /// each of the current peers on the wireless Hosted Network. The
        /// number of elements in the array is given by dwNumberOfPeers member.
        /// This value is correct only if HostedNetworkState is
        /// wlan_hosted_network_active.
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
        public WLAN_HOSTED_NETWORK_PEER_STATE[] PeerList;
    }
}
